/* eslint-disable no-empty-pattern */
import { api_modifyAdminIdsByIdRole, api_listAdminIdByIdRole } from '@/api/sys_admin_role'

const state = {}

const mutations = {}

const actions = {
  // 根据角色id修改所绑定的管理员id
  modifyAdminIdsByIdRole({}, paramsJson) {
    return new Promise((resolve, reject) => {
      api_modifyAdminIdsByIdRole(paramsJson)
        .then(() => {
          resolve()
        })
        .catch((error) => {
          reject(error)
        })
    })
  },
  // 根据角色id查询此角色所属的管理员id数组
  listAdminIdByIdRole({}, idRole) {
    return new Promise((resolve, reject) => {
      api_listAdminIdByIdRole(idRole)
        .then((response) => {
          resolve(response.data.data)
        })
        .catch((error) => {
          reject(error)
        })
    })
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
}
